<?php
	require_once '../lib/sql.utils.php';
	
	$categoryDetailId = $_POST['categoryDetailId'];
	$sql_util = new SqlUtils();
	$result = $sql_util -> getRows('SELECT * FROM categoryDetails WHERE categoryDetailId = '.$categoryDetailId);
?>
<div class="menu">
		Quản lý giá sách > Sửa giá sách
</div>
<form id="myForm" name="myForm" method="post" enctype="multipart/form-data" action="service/process_edit_category_detail.php">
	<input type="hidden" name="id" value="<?php echo $result[0]['categoryDetailId']; ?>" />
	<label for="name">Tên giá sách :</label>
	<input type="text" id="name" name="name" value="<?php echo $result[0]['categoryDetailName']; ?>" />
	<span id="check-name"></span>
	<br />
	<label for="category" >Thuộc Danh Mục</label>
	<select name="category">
		<?php
			$result_cate = $sql_util -> getRows('SELECT * FROM categories');
			for ($i=0; $i < count($result_cate); $i++) {
				echo '<option value="'.$result_cate[$i]['categoryId'].'">'.$result_cate[$i]['categoryName'].'</option>';
			}
		?>
	</select>
	<br/>
	<label for="description">Ghi chú :</label>	
	<textarea id="description" name="description" rows="10" cols="70" value="" >
		<?php echo $result[0]['categoryDetailDescription']; ?>
	</textarea>
	<br />
	<input type="submit" id="button" name="button" value="Submit"/>
</form>